package NiuKe;

public class PerfectPhrase {
    public static int[][] couple = {
            {2,11,21},
            {19,10,1},
            {20,11,1},
            {6,15,24},
            {18,27,36}
    };
    public static void main(String[] args) {
        int count = 0;
        for (int i = 0; i < couple.length; i++) {
            for (int j = 0; j < couple[i].length; j++) {
                boolean perfectPhrase = isPerfectPhrase(i, j);
                System.out.println(i + " " + j + "：" + perfectPhrase);
                if (perfectPhrase) {
                    count++;
                }
            }
        }
        System.out.println(count);
    }
    public static boolean isPerfectPhrase(int i,int j) {
        int preValue = couple[i][0] + couple[j][0];
        for (int k = 1; k < couple[0].length; k++) {
            int value = couple[i][k] + couple[j][k];
            if (preValue != value) {
                return false;
            }
        }
        return true;
    }
}
